package com.example.javabeantest.javaBeanSamples;

public class Convert {
    /**
     * 将数组转换为字符串
     * @param arr数组
     * @return 字符串
     */
    public String arr2Str(String[] arr){
        StringBuffer sb=new StringBuffer();
        if(arr!=null&&arr.length>0){
            for (String s:arr){
                sb.append(s);
                sb.append(",");
            }
            if (sb.length()>0){
                sb.deleteCharAt(sb.length()-1);
            }
        }
        return sb.toString();
    }
}
